package cc.linker.steplink.crm.merchant.service;

import cc.linker.steplink.crm.merchant.dao.MessageTipDao;
import cc.linker.steplink.crm.merchant.pojo.MessageTipPo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;
import java.util.Map;

@Slf4j
@Service
public class MessageTipService {

    @Autowired
    private MessageTipDao messageTipDao;

    public void save(Map<String, Object> params) {
        if(!StringUtils.isEmpty(params.get("id"))){
            //编辑
            messageTipDao.update(params);
        }else {
            //新增
            messageTipDao.add(params);
        }
    }

    public List<MessageTipPo> list() {
        return messageTipDao.list();
    }

    public void updateStatus(Map<String, Object> params) {
        messageTipDao.updateStatus(params);
    }

    public void delete(Map<String, Object> params) {
        messageTipDao.delete(params);
    }

    public MessageTipPo infoById(Long id) {
        return messageTipDao.infoById(id);
    }

    public List<MessageTipPo> viewList(Integer payMode,String userId) {
        return messageTipDao.viewList(payMode,userId);
    }

    public void read(Map<String, Object> params) {
        messageTipDao.read(params);
    }
}
